home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.IOException;
- import symjava.sql.SQLException;
-
- class EOT extends ServerObject {
- int _length;
- String _trailer;
-
- EOT(String trailer) {
- this._trailer = trailer;
- this._length = this._trailer.length() > 4 ? 4 : (short)this._trailer.length();
- }
-
- EOT() {
- this._trailer = new String("");
- this._length = 0;
- }
-
- int getType() {
- return 50;
- }
-
- void read(DataInputStream in) throws SQLException, IOException, ErrorException {
- this._length = in.readShort();
- if (this._length > 0) {
- byte[] b = new byte[this._length];
- in.readFully(b, 0, this._length);
- this._trailer = new String(b, 0);
- }
-
- }
-
- void write(DataOutputStream out) throws IOException {
- out.writeByte(this.getType());
- out.writeShort(this._length);
- if (this._length > 0) {
- out.writeChars(this._trailer);
- }
-
- }
- }
-